<template>
	<view>
		<view>{{gcname}}</view>
		<view class="formlist">
			<view class="ln"><view>合同名:</view><view>{{htdata.names}}</view></view>
			<view class="ln"><view>类型:</view><view>{{htType[htdata.tp]}}</view></view>
			<view class="ln"><view>供应商:</view><view>{{htdata.supplier}}</view></view>
			<view class="ln"><view>联系电话:</view><view>{{htdata.phone}}</view></view>
			<view class="ln"><view>联系人:</view><view>{{htdata.username}}</view></view>
			<view class="ln"><view>商品名:</view><view>{{htdata.goods}}</view></view>
			<view class="ln"><view>金额:</view><view>{{htdata.amount}}</view></view>
			<view class="ln"><view>时间:</view><view>{{htdata.tm}}</view></view>
			<view class="ln"><view>合同数量:</view><view>{{htdata.num}}</view></view>
			<view class="ln"><view>经办人:</view><view>{{htdata.operator}}</view></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				htid:0, //合同id
				gcid:0, //工程ID
				gcname:"",
				htdata:{tp:0,tm:"输入签订日期"}
			}
		},
		onLoad(opt){
			this.htid = opt.id|0;
			this.gcid = opt.gcid|0;
			this.gcname = opt.gcname;
			uni.setNavigationBarTitle({
				title:"合同明细"
			});
			if(this.htid > 0){
				this.loadht();
			}
		},
		methods: {
			loadht(){
				let self = this;
				uni.request({
					url:this.apibase + "htdetail?htid=" + this.htid,
					success: (res) => {
						self.htdata = res.data;
					}
				});
			}
		}
	}
</script>

<style>

</style>
